The modern communications era has brought about a tremendous expansion of wireline and wireless networks. Computer networks, television networks, and telephony networks are experiencing an unprecedented technological expansion, fueled by consumer demand. Wireless and mobile networking technologies have addressed related consumer demands, while providing more flexibility and immediacy of information transfer.
Current and future networking technologies continue to facilitate ease of information transfer and convenience to users. One area in which there is a demand to increase ease of information transfer and convenience to users relates to provision of various applications or software to users of electronic devices such as a mobile terminal. The applications or software may be executed from a local computer, a network server or other network device, or from the mobile terminal such as, for example, a mobile telephone, a mobile television, a mobile gaming system, etc, or even from a combination of the mobile terminal and the network device. In this regard, various applications and software have been developed and continue to be developed in order to give the users robust capabilities to perform tasks, communicate, entertain themselves, etc. in either fixed or mobile environments. However, many electronic devices which have different operating systems may require different versions of a particular application to be developed in order to permit operation of the particular application at each different type of electronic device. If such different versions were developed to correspond to each different operating system, the cost of developing software and applications would be increased.
Accordingly, virtual machines (VMs) have been developed. A VM is a self-contained operating environment that behaves as if it is a separate computer. The VM may itself be a piece of computer software that isolates the application being used by the user from the host computer or operating system. Typically, the VM consists of the execution engine and implementations of the standardized APIs. For example, Java applets run in a Java VM while having no access to the host operating system. Because versions of the VM are written for various computer platforms, any application written for the VM can be operated on any of the platforms, instead of having to produce separate versions of the application for each computer and operating system. One of the most popular languages based on a VM is Java. Java, which is well known in the industry, is extremely portable, flexible and powerful with respect to allowing applications to, for example, access mobile phone features through well-known standard APIs. Thus, Java has been widely used by developers to develop portable applications that can be run on a wide variety of electronic devices or computers without modification.
Particularly in mobile environments where resources are scarce due to consumer demand to reduce the cost and size of mobile terminals, it is important to conserve or reuse resources whenever possible. In this regard, efforts have been exerted to try to conserve or reclaim resources of mobile terminals when the resources are no longer needed by a particular application. Memory is one such resource for which it may be desirable to reduce consumption. In this regard, since more and more Java applications and application programming interfaces (APIs) are being supported by mobile terminals, a memory footprint of Java class libraries has been increasing.
In an effort to reduce the memory footprint of a Java class library or application, a technique known as “romizing” has been developed. During romizing, Java class files are typically transformed to Java VM specific format during the build phase. Some optimizations may be applied to class files during romizing since certain dynamic features of Java language may not be required for the class library. Examples of such optimizations may include combining constant pools of all classes and replacing duplicate strings with references pointing to an original string. All class files may be combined into a single large image. As a result of romizing, a size of the class library may be decreased and class loading performance of the Java VM may be improved.
However, romizing only decreases the size of some parts of the class file, which may include many separate parts that can be handled separately. For example, Java bytecode, which is an abstract or intermediate language, is one part of a Java class file. FIG. 7 is a graph illustrating an example of a static memory footprint of a typical class library in romized form. In this regard, although Java bytecode may represent about 27% of the Java class library memory footprint, Java bytecode size is not affected by romizing and is therefore not optimized in terms of size.
Given the above described problems, it may be advantageous to provide an improved mechanism for providing memory footprint reduction for languages, such as Java, that are based on using bytecode and need to store or transfer bytecode. Both applications and class libraries implementing APIs include bytecode, so both can benefit from improved memory footprint reduction mechanism.